<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>订单处理</title>

<link rel="stylesheet"
	href="${pageContext.request.contextPath}/css/tasp.css" />
<link href="${pageContext.request.contextPath}/css/orderconfirm.css"
	rel="stylesheet" />
<link href="${pageContext.request.contextPath}/css/easyui.css"
	rel="stylesheet" />
<link href="${pageContext.request.contextPath}/css/demo.css"
	rel="stylesheet" />
<link href="${pageContext.request.contextPath}/css/icon.css"
	rel="stylesheet" />
<style>
#page {
	width: auto;
}

#comm-header-inner, #content {
	width: 950px;
	margin: auto;
}

#logo {
	padding-top: 26px;
	padding-bottom: 12px;
}

#header .wrap-box {
	margin-top: -67px;
}

#logo .logo {
	position: relative;
	overflow: hidden;
	display: inline-block;
	width: 140px;
	height: 35px;
	font-size: 35px;
	line-height: 35px;
	color: #f40;
}

#logo .logo .i {
	position: absolute;
	width: 140px;
	height: 35px;
	top: 0;
	left: 0;
	background: url(http://a.tbcdn.cn/tbsp/img/header/logo.png);
}
</style>

</head>
<body data-spm="1">
	<div id="page">

		<div id="content" class="grid-c">

			<div id="address" class="address" style="margin-top: 20px;"
				data-spm="2">

				<h3>
					确认收货地址 <span class="manage-address"> </span>
				</h3>
				
						<!-- <ul id="showReceiptInfo">
							<li><input name="address" class="J_MakePoint " type="radio" value="674944241" 
								id="addrId_674944241" checked="checked" ></li> -->
							<li id="showrecAddress">收货地址：${orderInfo.recAddress }</li>
							<li id="showrecPerson">联系人：${orderInfo.recName }</li>
							<li id="showrecPhone">联系电话:${orderInfo.recPhone }</li>
						</ul>

				
				<ul id="J_MoreAddress" class="address-list hidden">

				</ul>

			<a href="javascript:void(0)" class="easyui-linkbutton" onclick="$('#w').window('open')">修改收货信息</a>
			<div id="w" class="easyui-window" closed="true"  title="请填写收货信息" data-options="iconCls:'icon-save',minimizable:false,tools:'#tt'" style="width:500px;height:200px;padding:10px;">

				<!-- <form> -->
				<table cellpadding="5">
					<tr>
						<td>收货地址:</td>
						<td><input  type="text" id="recAddress"
							name="recAddress"></input></td>
					</tr>
					<tr>
						<td>联系人:</td>
						<td><input  type="text" id="recPerson"
							name="recPerson"></input></td>
					</tr>
					<tr>
						<td>联系电话:</td>
						<td><input  type="text" id="recPhone"
							name="recPhone"></input></td>
						<td>
							<span id="len" style="color: red"></span>
						</td>
					</tr>
					<tr>
						<td><input id="commit" type="button" value="提交"></td>
						<td><input id="close" type="button" value="关闭"></td>
					</tr>
				</table>
				<input type="hidden" id="Id" value="${requestScope.orderInfo.id }">

				
				
				<!-- </form> -->
				<div style="text-align: center; padding: 5px">
					<!-- <a href="javascript:void(0)" id="submitForm">Submit</a>
							    	<input type="submit" value="提交">
							    	<a href="javascript:void(0)" class="easyui-linkbutton" onclick="clearForm()">Clear</a> -->
				</div>

			</div>




			</div>
			<form id="J_Form" name="J_Form" method="post" action="${pageContext.request.contextPath}/order/subOrder">

				<div>
					<h3 class="dib">确认订单信息</h3>
					<table cellspacing="0" cellpadding="0" class="order-table"
						id="J_OrderTable" summary="统一下单订单信息区域">
						<caption style="display: none">统一下单订单信息区域</caption>
						<thead>
							<tr>
								<th class="s-title">店铺宝贝
									<hr />
								</th>
								<th class="s-price">单价(元)
									<hr />
								</th>
								<th class="s-amount">数量
									<hr />
								</th>

								<th class="s-total">小计(元)
									<hr />
								</th>
							</tr>
						</thead>



						<tbody data-spm="3" class="J_Shop" data-tbcbid="0"
							data-outorderid="47285539868" data-isb2c="false"
							data-postMode="2" data-sellerid="1704508670">
							<tr class="first">
								<td colspan="5"></td>
							</tr>
							<tr class="shop blue-line">
								<td colspan="3">店铺：<a class="J_ShopName J_MakePoint"
									target="_blank">${orderInfo.storeName }</a> <span
									class="seller">卖家：<a  target="_blank"
										class="J_MakePoint">${orderInfo.saleName }</a></span>
									<span class="J_WangWang"></span>

								</td>
								<td colspan="2" class="promo">
									<div>
										<ul class="scrolling-promo-hint J_ScrollingPromoHint">
										</ul>
									</div>
								</td>
							</tr>
							<tr class="item"
								data-lineid="19614514619:31175333266:35612993875"
								data-pointRate="0">
								<td class="s-title"><a target="_blank"
									> <img
										src="http://img03.taobaocdn.com/bao/uploaded/i3/18670026332876589/T1A4icFbNeXXXXXXXX_!!0-item_pic.jpg_60x60.jpg"
										class="itempic"><span >${orderInfo.goodsName }</span>
								</a>

									<div class="props">
										<span>屏幕尺寸: ${orderInfo.screenSize }寸</span> <span>内存容量:
											${orderInfo.rom }G</span> <span>手机容量: ${orderInfo.ram }G</span> <span>版本:
											${orderInfo.version } </span>
									</div> </a></td>
								<td class="s-price"><span class='price '> <em
										class="style-normal-small-black J_ItemPrice">${orderInfo.singlePrice }</em>
								</span></td>
								<td class="s-amount" data-point-url=""><input type="hidden"
									class="J_Quantity" value="1"
									name="19614514619_31175333266_35612993875_quantity" />${orderInfo.num }

								</td>

								<td class="s-total"><span class='price '> <em
										class="style-normal-bold-red J_ItemTotal ">${orderInfo.sumPrice }</em>
								</span> <input id="furniture_service_list_b_47285539868" type="hidden"
									name="furniture_service_list_b_47285539868" /></td>
							</tr>



							<tr class="item-service">
								<td colspan="5" class="servicearea" style="display: none"></td>
							</tr>

							<tr class="blue-line" style="height: 2px;">
								<td colspan="5"></td>
							</tr>
							<tr class="other other-line">
								<td colspan="5">
									<ul class="dib-wrap">
										<li class="dib user-info">
											<ul class="wrap">
												<li>
						</tbody>
						<tfoot>
							<tr rowspan=10>
								<td colspan="5">

									<div class="order-go" data-spm="4">
										<div class="J_AddressConfirm address-confirm">
											<div class="kd-popup pop-back" style="margin-bottom: 40px;">
												<div class="box">
													<div class="bd">
														<div class="point-in">

															<em class="t">实付款：</em> <span class='price g_price '>
																<span>&yen;</span><em class="style-large-bold-red"
																id="J_ActualFee">${orderInfo.sumPrice }</em>
															</span>
														</div>

														<ul id="showReceiptInfo">
															<li id="showrecAddress1"></li>
															<li id="showrecPerson1"></li>
															<li id="showrecPhone1"></li>
														</ul>
													</div>
												</div>
												<input type="hidden" id="saleGoodsId" name="saleGoodsId" value="${orderInfo.id }">
												<input type="hidden" id="userAccountId" name="userAccountId" value="${orderInfo.userAccountId }">
												<input type="hidden" id="singlePrice" name="singlePrice" value="${orderInfo.singlePrice }">
												<input type="hidden" id="num" name="num" value="${orderInfo.num }">
												<input type="hidden" id="sumPrice" name="sumPrice" value="${orderInfo.sumPrice }">
												<input type="hidden" id="irecAddress" name="recAddress" value="${orderInfo.recAddress }">
												<input type="hidden" id="irecPhone" name="recPhone" value="${orderInfo.recPhone }">
												<input type="hidden" id="irecName" name="recName" value="${orderInfo.recName }">
												
												
												<button id="subBtn" class=" btn-go"  tabindex="0"
													title="点击此按钮，提交订单。">提交订单<b class="dpl-button"></b><button>
											</div>
										</div>

									</div>
									</div>
									</div>
								</td>
							</tr>
						</tfoot>
					</table>
				</div>


			</form>
		</div>

		<div id="footer"></div>
	</div>
</body>
<script type="text/javascript"
	src="${pageContext.request.contextPath}/js/jquery.min.js"></script>
<script type="text/javascript"
	src="${pageContext.request.contextPath}/js/jquery.easyui.min.js"></script>
<script type="text/javascript">
$(function(){
	
	window.onload=function(){
		$("#showrecAddress1").text($("#showrecAddress").text());
		$("#showrecPerson1").text($("#showrecPerson").text())
		$("#showrecPhone1").text($("#showrecPhone").text());
	}
	
	$("#commit").unbind('click').bind('click',function(){
		
		var value = $("#recPhone").val();
		if(value.length==11 && value.substr(0,1)==1){
			$('#w').window('close');
			$("#showrecAddress").text("收货地址：" + $("#recAddress").val());
			$("#showrecPerson").text("联系人：" + $("#recPerson").val())
			$("#showrecPhone").text("联系电话:" + $("#recPhone").val());
			$("#showrecAddress1").text($("#showrecAddress").text());
			$("#showrecPerson1").text($("#showrecPerson").text())
			$("#showrecPhone1").text($("#showrecPhone").text());
			
			$("#irecAddress").val($("#recAddress").val());
			$("#irecPhone").val($("#recPhone").val());
			$("#irecName").val($("#recPerson").val());
			/* $.ajax({
				 type:"POST",
				 url:"${pageContext.request.contextPath}/order/addReceiptInfo",
				 data:{
						recAddress: $("#recAddress").val(),
						recPerson: $("#recPerson").val(),
						recPhone: $("#recPhone").val(),
						orderId: $("#Id").val()
						},
				dataType:'json',
				success:function(data){
					
					if(data > 0){
						
						$('#w').window('close');
						$("#showrecAddress").text("收货地址：" + $("#recAddress").val());
						$("#showrecPerson").text("联系人：" + $("#recPerson").val())
						$("#showrecPhone").text("联系电话:" + $("#recPhone").val());
						$("#showrecAddress1").text($("#showrecAddress").text());
						$("#showrecPerson1").text($("#showrecPerson").text())
						$("#showrecPhone1").text($("#showrecPhone").text());
						
					}else{
						alert('地址填写失败！');
					}
				},
				error:function(){
					alert("地址填写失败！");
				
				}
			}) */
		}else{
			alert("请输入正确的格式！");
		}
		 	 
	});
	
	$("#close").unbind('click').bind('click',function(){
		$('#w').window('close');
	});
	
	$("#subBtn").click(function(){
		if($("#showrecAddress").text() == "收货地址:"){
			alert("请输入正确的收货地址");
			return false;
		}else if($("#showrecPerson").text() == "联系人："){
			alert("请输入正确的收货人姓名");
			return false;
		}else if($("#showrecPhone").text() == "联系电话:"){
			alert("请输入正确的联系电话");
			return false;
		}else{
			$("#J_Form").submit();
		}
		
		
	});
	
	/* $("#recPhone").blur(function(){
		
		var value = $("#recPhone").val();
		if(value.length<11)
		{
			len.html("电话号码不足十一位").css({color: "red" });
		}else if (value.length>11) {
			len.html("电话号码大于十一位").css({color: "red" });
		}else if (value.substr(0,1)!=1){
			len.html("电话号码不是以1开头").css({color: "red" });
		}else{
			len.html("Ok!").css({color: "blue" });
		}
		
	}); */
});
	</script>
</html>